package com.study.leetcode;

//https://leetcode.cn/problems/remove-duplicates-from-sorted-list/submissions/
public class Solution_83 {
    public ListNode deleteDuplicates(ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        head.next = deleteDuplicates(head.next);
        if (head.val == head.next.val) {
            head = head.next;
        }
        return head;
    }

    public static  void main(String[] args) {

    }
}
